package com.nanyang.tms.domain.forecast.context;

import java.io.Serializable;

import com.nanyang.common.core.flow.context.AbsTransHandlerContext;
import com.nanyang.common.tool.utils.convert.BeanUtils;
import com.nanyang.tms.domain.forecast.context.saveforecast.SaveForecastContext;

import lombok.Data;
@Data
public class ForecastAddContext extends AbsTransHandlerContext implements Serializable{
	private static final long serialVersionUID = 1L;
	private CalculateWeightContext calculateWeightContext;
	private CalculateFreightContext calculateFreightContext;
	private GetTicketNumberContext getTicketNumberContext;
	private SaveForecastContext saveForecastContext;
	public ForecastAddContext(){
		this.calculateWeightContext=new CalculateWeightContext();
		this.calculateFreightContext=new CalculateFreightContext();
		this.getTicketNumberContext=new GetTicketNumberContext();
		this.saveForecastContext=new SaveForecastContext();
	}
	
	
	
	
	
	@Override
	public Object getTransHandlerContext(Class<?> cls) {
		if(cls.getSimpleName().equals("CalculateWeightContext")){
			return this.getCalculateWeightContext();
		}
		else if (cls.getSimpleName().equals("CalculateFreightContext")){
			return this.getCalculateFreightContext();
		}
		else if (cls.getSimpleName().equals("GetTicketNumberContext")){
			return this.getGetTicketNumberContext();
		}
		else if (cls.getSimpleName().equals("SaveForecastContext")){
			return this.getSaveForecastContext();
		}
		else{
			throw new RuntimeException("无此属性");
		}
	}





}
